using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;

[CreateAssetMenu()]
public class HeightMapSettings : UpdatableData
{
    public NoiseSettings noiseSettings;
    public bool useFalloff;
    [FormerlySerializedAs("meshHeightMultiplier")] public float heightMultiplier;

    /// <summary>
    /// 高度曲线，避免水面高低起伏
    /// </summary>
    [FormerlySerializedAs("meshHeightCurve")] public AnimationCurve heightCurve;

    public float minHeight
    {
        get { return heightMultiplier * heightCurve.Evaluate(0); }
    }

    public float maxHeight
    {
        get { return heightMultiplier * heightCurve.Evaluate(1); }
    }

# if UNITY_EDITOR

    protected override void OnValidate()
    {
        noiseSettings.ValidateValues();
        base.OnValidate();
    }

# endif
}